package cn.gdut.chengcai.admin.controller;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.gdut.chengcai.base.ConstantUtil;
import cn.gdut.chengcai.base.CourseUtil;
import cn.gdut.chengcai.base.IdGenerator;
import cn.gdut.chengcai.base.JsonUtil;
import cn.gdut.chengcai.base.MessageUtil;
import cn.gdut.chengcai.base.Pager;
import cn.gdut.chengcai.base.PagerUtil;
import cn.gdut.chengcai.base.RequestUtil;
import cn.gdut.chengcai.base.ResponseData;
import cn.gdut.chengcai.base.UploadDownloadUtil;
import cn.gdut.chengcai.entity.CommentInfo;
import cn.gdut.chengcai.entity.CommentInfoExample;
import cn.gdut.chengcai.entity.CourseChapterInfo;
import cn.gdut.chengcai.entity.CourseChapterInfoExample;
import cn.gdut.chengcai.entity.CourseInfo;
import cn.gdut.chengcai.entity.CourseInfoExample;
import cn.gdut.chengcai.entity.CourseLessonInfo;
import cn.gdut.chengcai.entity.CourseLessonInfoExample;
import cn.gdut.chengcai.entity.UploadInfoEntity;
import cn.gdut.chengcai.enums.CourseCategoryType;
import cn.gdut.chengcai.enums.UploadFileType;
import cn.gdut.chengcai.service.CommentInfoService;
import cn.gdut.chengcai.service.CourseChapterInfoService;
import cn.gdut.chengcai.service.CourseInfoService;
import cn.gdut.chengcai.service.CourseLessonInfoService;
import cn.gdut.chengcai.vo.CourseChapterInfoVo;
import cn.gdut.chengcai.vo.CourseInfoVo;
import cn.gdut.chengcai.vo.CourseLessonInfoVo;

@Controller
@RequestMapping("/admin/course")
public class Admin_CourseController {

	@Autowired
	protected CourseInfoService courseInfoService;

	@Autowired
	protected CourseChapterInfoService courseChapterInfoService;

	@Autowired
	protected CourseLessonInfoService courseLessonInfoService;
	
	@Autowired
	protected CommentInfoService commentInfoService;

	/**
	 * 课程新增页
	 */
	@RequestMapping("/addnew")
	public String courseAddnew(ModelMap map) {
		return "/admin/course/addnew";
	}

	/**
	 * 章新增页
	 */
	@RequestMapping("/{courseId}/chapter/addnew")
	public String chapterAddnew(ModelMap map, @PathVariable Long courseId) {
		CourseInfo courseInfo = courseInfoService.selectByPrimaryKey(courseId);
		CourseInfoVo courseInfoVo = new CourseInfoVo();
		try {
			CourseUtil.fillVo(courseInfo, courseInfoVo);
			map.put("course", courseInfoVo);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return "/admin/course/chapter/addnew";
	}

	/**
	 * 节新增页
	 */
	@RequestMapping("/{courseId}/chapter/{chapterId}/lesson/addnew")
	public String lessonAddnew(ModelMap map, @PathVariable Long courseId, @PathVariable Long chapterId) {

		CourseInfo courseInfo = courseInfoService.selectByPrimaryKey(courseId);
		CourseInfoVo courseInfoVo = new CourseInfoVo();

		CourseChapterInfo chapterInfo = courseChapterInfoService.selectByPrimaryKey(chapterId);
		CourseChapterInfoVo chapterInfoVo = new CourseChapterInfoVo();
		try {
			CourseUtil.fillVo(courseInfo, courseInfoVo);
			CourseUtil.fillVo(chapterInfo, chapterInfoVo);
			map.put("course", courseInfoVo);
			map.put("chapter", chapterInfoVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "/admin/course/lesson/addnew";
	}

	/**
	 * 课程新增操作
	 */

	@RequestMapping("/addnewAction")
	public String courseAddnewAction(HttpServletRequest request, HttpSession session) {

		CourseInfo courseInfo = new CourseInfo();
		courseInfo.setSn(IdGenerator.generatorCourseSn());
		courseInfo.setName(RequestUtil.getParameter(request, "name"));
		courseInfo.setSpeakerName(RequestUtil.getParameter(request, "speakerName"));
		courseInfo.setIntro(RequestUtil.getParameter(request, "intro"));
		courseInfo.setTotalPrice(Long.parseLong(RequestUtil.getParameter(request, "totalPrice")));
		if (courseInfo.getTotalPrice() > 0) {
			courseInfo.setIsFree(false);
		} else {
			courseInfo.setIsFree(true);
		}
		courseInfo.setLevel(Byte.parseByte(RequestUtil.getParameter(request, "level")));
		courseInfo.setCatalogId(Byte.parseByte(RequestUtil.getParameter(request, "catalogId")));
		courseInfo.setCategoryName(CourseCategoryType.getString((int) courseInfo.getCatalogId()));
		courseInfo.setChapterNum(0);
		courseInfo.setLessonNum(0);
		courseInfo.setCommentCount(0L);
		courseInfo.setViewCount(0L);
		courseInfo.setIsDeleted(false);
		courseInfo.setIsShow(true);
		courseInfo.setCreateTime(new Date());

		// 上传处理
		Map<Integer, UploadInfoEntity> map = UploadDownloadUtil.uploadAction(request, session,
				UploadFileType.PROFILE.getValue(), courseInfo.getCreateTime());
		if (null != map && map.size() != 0) {
			String filename = "";
			if (null != map.get(1)) {
				filename = courseInfo.getPicUrl();
				if (StringUtils.isEmpty(filename) == false) {
					UploadDownloadUtil.deleteAction(filename);
				}
				courseInfo.setPicUrl(map.get(1).getFileUrl());
			}
		}

		courseInfoService.insert(courseInfo);
		return "redirect:/admin/course/list.do";
	}

	/**
	 * 章新增操作
	 * 
	 */

	@RequestMapping(value = "/{courseId}/chapter/addnewAction", method = { RequestMethod.POST }, produces = {
			"application/json;charset=UTF-8" })
	@ResponseBody
	public ResponseData<Object> chapterAddnewAction(@RequestBody String jsonString, @PathVariable Long courseId) {
		ResponseData<Object> result = new ResponseData<>();
		result.setIsSuccess(false);
		try {

			CourseInfo courseInfo = courseInfoService.selectByPrimaryKey(courseId);
			courseInfo.setChapterNum(courseInfo.getChapterNum() + 1);
			courseInfoService.updateByPrimaryKey(courseInfo);

			CourseChapterInfo entity = (CourseChapterInfo) JsonUtil.fromJson(jsonString, CourseChapterInfo.class);
			entity.setSn(IdGenerator.generatorCourseSn());
			entity.setCourseId(courseId);
			entity.setCourseSn(courseInfo.getSn());
			entity.setCourseName(courseInfo.getName());
			entity.setIsDeleted(false);
			entity.setLessonNum(0);
			entity.setCreateTime(new Date());
			courseChapterInfoService.insert(entity);

			result.setIsSuccess(true);
		} catch (Exception e) {
			result.setMessage(MessageUtil.SYSTEM_ERROR);
		}
		return result;
	}

	/**
	 * 节新增操作
	 */

	@RequestMapping("/{courseId}/chapter/{chapterId}/lesson/addnewAction")
	public String lessonAddnewAction(HttpServletRequest request, HttpSession session, @PathVariable Long courseId,
			@PathVariable Long chapterId) {

		CourseInfo courseInfo = courseInfoService.selectByPrimaryKey(courseId);
		courseInfo.setLessonNum(courseInfo.getLessonNum() + 1);
		courseInfoService.updateByPrimaryKey(courseInfo);

		CourseChapterInfo chapterInfo = courseChapterInfoService.selectByPrimaryKey(chapterId);
		chapterInfo.setLessonNum(chapterInfo.getLessonNum() + 1);
		courseChapterInfoService.updateByPrimaryKey(chapterInfo);

		CourseLessonInfo lessonInfo = new CourseLessonInfo();
		lessonInfo.setSn(IdGenerator.generatorCourseSn());
		lessonInfo.setName(RequestUtil.getParameter(request, "name"));
		lessonInfo.setCourseId(courseId);
		lessonInfo.setCourseSn(courseInfo.getSn());
		lessonInfo.setCourseName(courseInfo.getName());
		lessonInfo.setChapterId(chapterId);
		lessonInfo.setChapterSn(chapterInfo.getSn());
		lessonInfo.setChapterName(chapterInfo.getName());
		lessonInfo.setIsDeleted(false);
		lessonInfo.setIsShow(true);
		lessonInfo.setCreateTime(new Date());

		// 上传处理
		Map<Integer, UploadInfoEntity> map = UploadDownloadUtil.uploadVideoAction(request, session,
				UploadFileType.COURSEWARE.getValue(), lessonInfo.getCreateTime());
		if (null != map && map.size() != 0) {
			String filename = "";
			if (null != map.get(1)) {
				filename = lessonInfo.getCoursewareUrl();
				if (StringUtils.isEmpty(filename) == false) {
					UploadDownloadUtil.deleteAction(filename);
				}
				lessonInfo.setCoursewareUrl(map.get(1).getFileUrl());
			}
		}

		courseLessonInfoService.insert(lessonInfo);
		return "redirect:/admin/course/" + courseId + "/chapter/" + chapterId + "/lesson/list.do";
	}

	/**
	 * 课程列表页
	 */
	@RequestMapping("/list")
	public String courseList(HttpSession session, ModelMap map) {

		CourseInfoExample example = new CourseInfoExample();
		example.createCriteria().andIsDeletedEqualTo(false);
		List<CourseInfo> listTotal = courseInfoService.selectByExample(example);
		Long itemCount = Long.valueOf(String.valueOf(listTotal.size()));
		Pager pager = PagerUtil.getPager(session, itemCount);
		int fromIndex = (pager.getPageNo() - 1) * pager.getPageSize();

		if (fromIndex >= listTotal.size()) {
			fromIndex = 0;
			pager.setPageNo(1);
			session.setAttribute(ConstantUtil.STR_PAGE_NO, "1");
		}
		int toIndex = fromIndex + pager.getPageSize();
		if (toIndex >= listTotal.size()) {
			toIndex = listTotal.size();
		}
		List<CourseInfo> list = listTotal.subList(fromIndex, toIndex);
		try {
			if ((null != list) && (list.size() > 0)) {
				List<CourseInfoVo> voList = new ArrayList<>();
				CourseUtil.fillCourseVoList(list, voList);
				map.put("list", voList);
				session.setAttribute("pager", pager);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

		return "/admin/course/list";
	}

	/**
	 * 课程信息详情页
	 */
	@RequestMapping("/{sn}/detail")
	public String courseDetail(HttpSession session, ModelMap map, @PathVariable String sn) {
		CourseInfoExample example = new CourseInfoExample();
		example.createCriteria().andSnEqualTo(sn);
		List<CourseInfo> list = courseInfoService.selectByExample(example);

		if ((null != list) && (list.size() > 0)) {
			CourseInfo entity = list.get(0);
			CourseInfoVo vo = new CourseInfoVo();
			try {
				CourseUtil.fillVo(entity, vo);
				map.put("entity", vo);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return "/admin/course/detail";
	}

	/**
	 * 课程删除操作
	 */
	@RequestMapping(value = "/delete/{courseId}", method = { RequestMethod.POST })
	@ResponseBody
	public ResponseData<Object> courseDeleteAction(@PathVariable Long courseId) {
		ResponseData<Object> result = new ResponseData<>();
		result.setIsSuccess(false);
		try {

			// 逻辑删除

			CourseLessonInfoExample lessonInfoExample = new CourseLessonInfoExample();
			lessonInfoExample.createCriteria().andCourseIdEqualTo(courseId);
			List<CourseLessonInfo> lessonInfos = courseLessonInfoService.selectByExample(lessonInfoExample);
			if ((null != lessonInfos) && (lessonInfos.size() > 0)) {
				for (CourseLessonInfo lesson : lessonInfos) {
					lesson.setIsDeleted(true);
					courseLessonInfoService.updateByPrimaryKey(lesson);
				}
			}

			CourseChapterInfoExample chapterInfoExample = new CourseChapterInfoExample();
			chapterInfoExample.createCriteria().andCourseIdEqualTo(courseId);
			List<CourseChapterInfo> chapterInfos = courseChapterInfoService.selectByExample(chapterInfoExample);
			if ((null != chapterInfos) && (chapterInfos.size() > 0)) {
				for (CourseChapterInfo chapater : chapterInfos) {
					chapater.setIsDeleted(true);
					courseChapterInfoService.updateByPrimaryKey(chapater);
				}
			}

			CourseInfo course = courseInfoService.selectByPrimaryKey(courseId);
			course.setIsDeleted(true);
			courseInfoService.updateByPrimaryKey(course);
			
			//删除该课程的所有评论
			CommentInfoExample example = new CommentInfoExample();
			example.createCriteria().andIsDeletedEqualTo(false).andTargetIdEqualTo(courseId);
			List<CommentInfo> list = commentInfoService.selectByExample(example);
			for(CommentInfo info: list){
				info.setIsDeleted(true);
				commentInfoService.updateByPrimaryKey(info);
			}
			

			result.setIsSuccess(true);
		} catch (Exception e) {
			result.setMessage(MessageUtil.SYSTEM_ERROR);
			// log.error(e.getMessage(), e);
		}
		return result;
	}

	/**
	 * 章列表页
	 */
	@RequestMapping("/{courseId}/chapter/list")
	public String chapterList(HttpSession session, ModelMap map, @PathVariable Long courseId) {
		CourseInfo course = courseInfoService.selectByPrimaryKey(courseId);
		CourseInfoVo courseInfoVo = new CourseInfoVo();
		CourseChapterInfoExample example = new CourseChapterInfoExample();
		example.createCriteria().andIsDeletedEqualTo(false).andCourseIdEqualTo(courseId);
		List<CourseChapterInfo> listTotal = courseChapterInfoService.selectByExample(example);
		Long itemCount = Long.valueOf(String.valueOf(listTotal.size()));
		Pager pager = PagerUtil.getPager(session, itemCount);
		int fromIndex = (pager.getPageNo() - 1) * pager.getPageSize();

		if (fromIndex >= listTotal.size()) {
			fromIndex = 0;
			pager.setPageNo(1);
			session.setAttribute(ConstantUtil.STR_PAGE_NO, "1");
		}
		int toIndex = fromIndex + pager.getPageSize();
		if (toIndex >= listTotal.size()) {
			toIndex = listTotal.size();
		}
		List<CourseChapterInfo> list = listTotal.subList(fromIndex, toIndex);
		try {
			if ((null != list) && (list.size() > 0)) {
				List<CourseChapterInfoVo> voList = new ArrayList<>();
				CourseUtil.fillChapterVoList(list, voList);
				map.put("list", voList);
				session.setAttribute("pager", pager);
			}

			CourseUtil.fillVo(course, courseInfoVo);
			map.put("course", courseInfoVo);

		} catch (Exception e) {
			e.printStackTrace();
		}

		return "/admin/course/chapter/list";
	}

	/**
	 * 章信息详情页
	 */
	@RequestMapping("/{courseId}/chapter/{chapterId}/detail")
	public String chapterDetail(HttpSession session, ModelMap map, @PathVariable Long courseId,
			@PathVariable Long chapterId) {

		CourseInfo course = courseInfoService.selectByPrimaryKey(courseId);
		CourseInfoVo courseInfoVo = new CourseInfoVo();
		CourseChapterInfo entity = courseChapterInfoService.selectByPrimaryKey(chapterId);
		CourseChapterInfoVo vo = new CourseChapterInfoVo();
		try {

			CourseUtil.fillVo(course, courseInfoVo);
			map.put("course", courseInfoVo);

			CourseUtil.fillVo(entity, vo);
			map.put("entity", vo);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return "/admin/course/chapter/detail";
	}

	/**
	 * 章删除操作
	 */
	@RequestMapping(value = "{courseId}/chapter/delete/{chapterId}", method = { RequestMethod.POST })
	@ResponseBody
	public ResponseData<Object> chapterDeleteAction(@PathVariable Long courseId, @PathVariable Long chapterId) {
		ResponseData<Object> result = new ResponseData<>();
		result.setIsSuccess(false);
		try {

			// 逻辑删除

			CourseLessonInfoExample lessonInfoExample = new CourseLessonInfoExample();
			lessonInfoExample.createCriteria().andChapterIdEqualTo(chapterId);
			List<CourseLessonInfo> lessonInfos = courseLessonInfoService.selectByExample(lessonInfoExample);
			int lessonNum = lessonInfos.size();
			if ((null != lessonInfos) && (lessonInfos.size() > 0)) {
				for (CourseLessonInfo lesson : lessonInfos) {
					lesson.setIsDeleted(true);
					courseLessonInfoService.updateByPrimaryKey(lesson);
				}
			}

			CourseChapterInfo chapter = courseChapterInfoService.selectByPrimaryKey(chapterId);
			chapter.setIsDeleted(true);
			courseChapterInfoService.updateByPrimaryKey(chapter);

			CourseInfo course = courseInfoService.selectByPrimaryKey(courseId);
			course.setLessonNum(course.getLessonNum() - lessonNum);
			course.setChapterNum(course.getChapterNum() - 1);
			courseInfoService.updateByPrimaryKey(course);

			result.setIsSuccess(true);
		} catch (Exception e) {
			result.setMessage(MessageUtil.SYSTEM_ERROR);
			// log.error(e.getMessage(), e);
		}
		return result;
	}

	/**
	 * 节列表页
	 */
	@RequestMapping("/{courseId}/chapter/{chapterId}/lesson/list")
	public String lessonList(HttpSession session, ModelMap map, @PathVariable Long courseId,
			@PathVariable Long chapterId) {

		CourseInfo course = courseInfoService.selectByPrimaryKey(courseId);
		CourseInfoVo courseInfoVo = new CourseInfoVo();

		CourseChapterInfo chapter = courseChapterInfoService.selectByPrimaryKey(chapterId);
		CourseChapterInfoVo chapterInfoVo = new CourseChapterInfoVo();

		CourseLessonInfoExample example = new CourseLessonInfoExample();
		example.createCriteria().andIsDeletedEqualTo(false).andChapterIdEqualTo(chapterId).andCourseIdEqualTo(courseId);
		List<CourseLessonInfo> listTotal = courseLessonInfoService.selectByExample(example);
		Long itemCount = Long.valueOf(String.valueOf(listTotal.size()));
		Pager pager = PagerUtil.getPager(session, itemCount);
		int fromIndex = (pager.getPageNo() - 1) * pager.getPageSize();

		if (fromIndex >= listTotal.size()) {
			fromIndex = 0;
			pager.setPageNo(1);
			session.setAttribute(ConstantUtil.STR_PAGE_NO, "1");
		}
		int toIndex = fromIndex + pager.getPageSize();
		if (toIndex >= listTotal.size()) {
			toIndex = listTotal.size();
		}
		List<CourseLessonInfo> list = listTotal.subList(fromIndex, toIndex);

		try {
			if ((null != list) && (list.size() > 0)) {
				List<CourseLessonInfoVo> voList = new ArrayList<>();
				CourseUtil.fillLessonVoList(list, voList);
				map.put("list", voList);
				session.setAttribute("pager", pager);
			}

			CourseUtil.fillVo(course, courseInfoVo);
			CourseUtil.fillVo(chapter, chapterInfoVo);
			map.put("course", courseInfoVo);
			map.put("chapter", chapterInfoVo);
		} catch (Exception e) {
			e.printStackTrace();
		}

		return "/admin/course/lesson/list";
	}

	/**
	 * 节信息详情页
	 */
	@RequestMapping("/{courseId}/chapter/{chapterId}/lesson/{lessonId}/detail")
	public String lessonDetail(HttpSession session, ModelMap map, @PathVariable Long courseId,
			@PathVariable Long chapterId, @PathVariable Long lessonId) {

		CourseInfo course = courseInfoService.selectByPrimaryKey(courseId);
		CourseInfoVo courseInfoVo = new CourseInfoVo();
		CourseChapterInfo chapter = courseChapterInfoService.selectByPrimaryKey(chapterId);
		CourseChapterInfoVo chapterInfoVo = new CourseChapterInfoVo();
		CourseLessonInfo entity = courseLessonInfoService.selectByPrimaryKey(lessonId);
		CourseLessonInfoVo vo = new CourseLessonInfoVo();
		try {

			CourseUtil.fillVo(course, courseInfoVo);
			map.put("course", courseInfoVo);

			CourseUtil.fillVo(chapter, chapterInfoVo);
			map.put("chapter", chapterInfoVo);

			CourseUtil.fillVo(entity, vo);
			map.put("entity", vo);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return "/admin/course/lesson/detail";
	}

	/**
	 * 节删除操作
	 */
	@RequestMapping(value = "/{courseId}/chapter/{chapterId}/delete/{lessonId}", method = { RequestMethod.POST })
	@ResponseBody
	public ResponseData<Object> lessonDeleteAction(@PathVariable Long courseId, @PathVariable Long chapterId,
			@PathVariable Long lessonId) {
		ResponseData<Object> result = new ResponseData<>();
		result.setIsSuccess(false);
		try {

			// 逻辑删除
			CourseLessonInfo lessonInfo = courseLessonInfoService.selectByPrimaryKey(lessonId);
			lessonInfo.setIsDeleted(true);
			courseLessonInfoService.updateByPrimaryKey(lessonInfo);

			CourseChapterInfo chapterInfo = courseChapterInfoService.selectByPrimaryKey(chapterId);
			chapterInfo.setLessonNum(chapterInfo.getLessonNum() - 1);
			courseChapterInfoService.updateByPrimaryKey(chapterInfo);

			CourseInfo course = courseInfoService.selectByPrimaryKey(courseId);
			course.setLessonNum(course.getLessonNum() - 1);
			courseInfoService.updateByPrimaryKey(course);

			result.setIsSuccess(true);
		} catch (Exception e) {
			result.setMessage(MessageUtil.SYSTEM_ERROR);
			// log.error(e.getMessage(), e);
		}
		return result;
	}
	/**
	 * 会员搜索页
	 */
	/*
	 * @RequestMapping("/personal/search") public String search(HttpSession
	 * session, ModelMap map) {
	 * 
	 * if (session.getAttribute(ConstantUtil.SESSION_SEARCH_PARAM) instanceof
	 * MemberSearchParam) {
	 * 
	 * } else { session.setAttribute(ConstantUtil.SESSION_SEARCH_PARAM, null); }
	 * // filter必须放最后面，不然，pager会被覆盖！！！ try { MemberUtil.filter(session, map,
	 * memberInfoService, null); } catch (Exception e) { e.printStackTrace(); }
	 * 
	 * return "/admin/member/personal/search"; }
	 */

	/**
	 * 获取会员的过滤条件
	 */
	/*
	 * @RequestMapping(value = "/personal/resetSearchFilterAction", method =
	 * RequestMethod.POST)
	 * 
	 * @ResponseBody
	 */
	/*
	 * public ResponseData<Object> resetSearchFilterAction(@RequestBody String
	 * jsonString, HttpServletRequest request, HttpSession session) {
	 * ResponseData<Object> result = new ResponseData<>();
	 * result.setIsSuccess(false); try { MemberSearchParam param =
	 * (MemberSearchParam)
	 * session.getAttribute(ConstantUtil.SESSION_SEARCH_PARAM); if (param ==
	 * null) { param = new MemberSearchParam();
	 * MemberUtil.resetSearchParamConstant(param); } result.setData(param);
	 * result.setIsSuccess(true); } catch (Exception e) { e.printStackTrace();
	 * result.setMessage(MessageUtil.SYSTEM_ERROR); // log.error(e.getMessage(),
	 * e); }
	 * 
	 * return result; }
	 */

	/**
	 * 会员的搜索过滤
	 */
	/*
	 * @RequestMapping(value = "/personal/reloadDataAction", method =
	 * RequestMethod.POST)
	 * 
	 * @ResponseBody public ResponseData<Object> reloadDataAction(@RequestBody
	 * String jsonString, HttpSession session, ModelMap map) {
	 * ResponseData<Object> result = new ResponseData<>();
	 * result.setIsSuccess(false);
	 * 
	 * MemberSearchParam param = (MemberSearchParam)
	 * JsonUtil.fromJson(jsonString, MemberSearchParam.class); try {
	 * List<MemberInfoVo> voList = MemberUtil.filter(session, map,
	 * memberInfoService, param); result.setData(voList);
	 * result.setPager((Pager) session.getAttribute("pager"));
	 * result.setIsSuccess(true); } catch (Exception e) { e.printStackTrace();
	 * result.setMessage(MessageUtil.SYSTEM_ERROR); // log.error(e.getMessage(),
	 * e); } return result; }
	 */

}